How to calculate sum by comparing key value with two object in javascript